const inspect=require('util').inspect;
const path=require('path');
const fs=require('fs');
const Busboy=require('busboy');


//创建目录
function mkdirSync(dirname){
	if(fs.existsSync(dirname)){
		return true
	}else{
		if(mkdirsSync(path.dirname(dirname))){
			fs.mkdirSync(dirname)
			return true;
		}
	}
}

function getSuffixName(filename){
	let namelist=filename.split('.');
	return namelist[namelist.length-1];
}

function uploadFile(ctx,options){
	let req=ctx.req;
	let busboy=new Busboy({headers:res.headers});
	let dir=options.dir||'common';
	let filePath=path.join(options.path,dir);
	let mkdirResult=mkdirSync(filePath);
	return new Promise((resolve,reject)=>{
		console.log('文件上传中...');
		let result={
			success:false
		}
	})
}